package com.sinochem.iot.rule.common;

public enum TriggerDescEnum {
    KAFKA(1, "KAFKA"),
    SERVER1(2, "SERVER1"),
    SERVER2(3, "SERVER2"),
    SERVER3(4, "SERVER3"),;
    public int key;
    public String val;

    private TriggerDescEnum(int key, String val) {
        this.key = key;
        this.val = val;
    }

    public static String getName(int index) {
        for (TriggerDescEnum d : TriggerDescEnum.values()
                ) {
            if (d.getKey() == index) {
                return d.val;
            }
        }
        return null;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getVal() {
        return val;
    }

    public void setVal(String val) {
        this.val = val;
    }
}
